<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>

	<body>
		<script>
			function Humans(name) {
				this.name = name;
				this.clothing = [
					"trousers",
					"dress",
					"jacket"
				];
			}
			Humans.prototype.sayName = function() {
				alert(this.name)
			}

			function Man(name, age) {
				Humans.call(this, name); //继承属性
				this.age = age;
			}

			Man.prototype = new Humans(); //继承方法
			Man.prototype.sayAge = function() {
				alert(this.age);
			}
			var man1 = new Man("mary", "30");
			man1.clothing.push("cost");
			alert(man1.clothing);
			man1.sayName();
			man1.sayAge();

			var man2 = new Man("阿三 ","30");
					alert(man2.clothing);

					man2.sayName(); man2.sayAge();
		</script>
	</body>

</html>